package com.ruangong.GitClient.Test.GiteeAPITest;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.ruangong.GitClient.GiteeAPI.GiteeRepository;
import com.ruangong.GitClient.GiteeAPI.GiteeUser;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

public class Test3 {
    public static void main(String[] args) {
        System.out.println("Hello, Gitee!");
        GiteeUser giteeUser = new GiteeUser("e751bc5f27b389245d1f32a630df020b","9649b65faee309bbae1eec463a973a4edfcb25e166ae6a57387cc55130a5b777");
        giteeUser.showInfo();
        OkHttpClient client = new OkHttpClient();
        String userName = "SilverXQ";
        String url = "https://gitee.com/api/v5/user/repos?access_token=" + giteeUser.getAccessToken() + "&type=all&sort=full_name&page=1&per_page=20";
//        String url2="https://gitee.com/api/v5/user/repos?access_token=c7024531e3dac960466431dace160cd7&type=all&sort=full_name&page=1&per_page=20";
        System.out.println(url);

        Request request = new Request.Builder()
                .url(url)
//                .header("Authorization","token "+giteeUser.getAccessToken())
                .build();

        try (Response response = client.newCall(request).execute()) {
            if (response.isSuccessful()) {
                assert response.body() != null;
                String jsonResponse = response.body().string();
                System.out.println(jsonResponse);
                Gson gson = new Gson();
                Type listType = new TypeToken<List<GiteeRepository>>() {
                }.getType();
                List<GiteeRepository> repos = gson.fromJson(jsonResponse, listType);
                GiteeRepository repo = new GiteeRepository();
                /*
                this.id = id;
        this.full_name = full_name;
        this.human_name = human_name;
        this.url = url;
        this.namespace = namespace;
        this.path = path;
        this.name = name;
        this.owner = owner;
        this.assigner = assigner;
        this.description = description;
        this.isPrivate = isPrivate;
        this.isPublic = isPublic;
        this.isInternal = isInternal;
        this.isFork = isFork;
        this.html_url = html_url;
        this.ssh_url = ssh_url;
        this.forks_url = forks_url;
        this.keys_url = keys_url;
        this.collaborators_url = collaborators_url;
        this.hooks_url = hooks_url;
        this.branches_url = branches_url;
        this.tags_url = tags_url;
        this.blobs_url = blobs_url;
        this.stargazers_url = stargazers_url;
        this.contributors_url = contributors_url;
        this.commits_url = commits_url;
        this.comments_url = comments_url;
        this.issue_comment_url = issue_comment_url;
        this.issues_url = issues_url;
        this.pulls_url = pulls_url;
        this.milestones_url = milestones_url;
        this.notifications_url = notifications_url;
        this.labels_url = labels_url;
        this.releases_url = releases_url;
        this.recommend = recommend;
        this.gvp = gvp;
        this.homepage = homepage;
        this.language = language;
        this.forks_count = forks_count;
        this.stargazers_count = stargazers_count;
        this.watchers_count = watchers_count;
        this.default_branch = default_branch;
        this.open_issues_count = open_issues_count;
        this.has_issues = has_issues;
        this.has_wiki = has_wiki;
        this.issue_comment = issue_comment;
        this.can_comment = can_comment;
        this.pull_requests_enabled = pull_requests_enabled;
        this.has_page = has_page;
        this.license = license;
        this.outsourced = outsourced;
        this.project_creator = project_creator;
        this.members = members;
        this.pushed_at = pushed_at;
        this.created_at = created_at;
        this.updated_at = updated_at;
        this.parent = parent;
        this.paas = paas;
        this.stared = stared;
        this.watched = watched;
        this.permission = permission;
        this.relation = relation;
        this.assignees_number = assignees_number;
        this.testers_number = testers_number;
        this.assignee = assignee;
        this.testers = testers;
        this.status = status;
        this.programs = programs;
        this.enterprise = enterprise;
        this.project_labels = project_labels;
        this.issue_template_source = issue_template_source;
                 */
                repo = repos.get(0);
                System.out.println("Repository id: " + repo.getId());
                System.out.println("Repository full_name: " + repo.getFull_name());
                System.out.println("Repository human_name: " + repo.getHuman_name());
                System.out.println("Repository url: " + repo.getUrl());
                System.out.println("Repository namespace: " + repo.getNamespace());
                System.out.println("Repository path: " + repo.getPath());
                System.out.println("Repository name: " + repo.getName());
                System.out.println("Repository owner: " + repo.getOwner());
                System.out.println("Repository assigner: " + repo.getAssigner());
                System.out.println("Repository description " + repo.getDescription());
                System.out.println("Repository private: " + repo.getPrivate());
                System.out.println("Repository public: " + repo.getPublic());
                System.out.println("Repository internal: " + repo.getInternal());
                System.out.println("Repository fork: " + repo.isIsFork());
                System.out.println("Repository html_url: " + repo.getHtml_url());
                System.out.println("Repository ssh_url: " + repo.getSsh_url());
                System.out.println("Repository forks_url: " + repo.getForks_url());
                System.out.println("Repository keys_url: " + repo.getKeys_url());
                System.out.println("Repository collaborators_url: " + repo.getCollaborators_url());
                System.out.println("Repository hooks_url: " + repo.getHooks_url());
                System.out.println("Repository branches_url: " + repo.getBranches_url());
                System.out.println("Repository tags_url: " + repo.getTags_url());
                System.out.println("Repository blobs_url: " + repo.getBlobs_url());
                System.out.println("Repository stargazers_url: " + repo.getStargazers_url());
                System.out.println("Repository contributors_url: " + repo.getContributors_url());
                System.out.println("Repository commits_url: " + repo.getCommits_url());
                System.out.println("Repository comments_url: " + repo.getComments_url());
                System.out.println("Repository issue_comment_url: " + repo.getIssue_comment_url());
                System.out.println("Repository issues_url: " + repo.getIssues_url());
                System.out.println("Repository pulls_url: " + repo.getPulls_url());
                System.out.println("Repository milestones_url: " + repo.getMilestones_url());
                System.out.println("Repository notifications_url: " + repo.getNotifications_url());
                System.out.println("Repository labels_url: " + repo.getLabels_url());
                System.out.println("Repository releases_url: " + repo.getReleases_url());
                System.out.println("Repository recommend: " + repo.isRecommend());
                System.out.println("Repository gvp: " + repo.isGvp());
                System.out.println("Repository homepage: " + repo.getHomepage());
                System.out.println("Repository language: " + repo.getLanguage());
                System.out.println("Repository forks_count: " + repo.getForks_count());
                System.out.println("Repository stargazers_count: " + repo.getStargazers_count());
                System.out.println("Repository watchers_count: " + repo.getWatchers_count());
                System.out.println("Repository default_branch: " + repo.getDefault_branch());
                System.out.println("Repository open_issues_count: " + repo.getOpen_issues_count());
                System.out.println("Repository has_issues: " + repo.isHas_issues());
                System.out.println("Repository has_wiki: " + repo.isHas_wiki());
                System.out.println("Repository issue_comment: " + repo.isIssue_comment());
                System.out.println("Repository can_comment: " + repo.isCan_comment());
                System.out.println("Repository pull_requests_enabled: " + repo.isPull_requests_enabled());
                System.out.println("Repository has_page: " + repo.isHas_page());
                System.out.println("Repository license: " + repo.getLicense());
                System.out.println("Repository outsourced: " + repo.isOutsourced());
                System.out.println("Repository project_creator: " + repo.getProject_creator());
                System.out.println("Repository members: " + repo.getMembers());
                System.out.println("Repository pushed_at: " + repo.getPushed_at());
                System.out.println("Repository created_at: " + repo.getCreated_at());
                System.out.println("Repository updated_at: " + repo.getUpdated_at());
                System.out.println("Repository parent: " + repo.getParent());
                System.out.println("Repository paas: " + repo.getPaas());
                System.out.println("Repository stared: " + repo.isStared());
                System.out.println("Repository watched: " + repo.isWatched());
                System.out.println("Repository permission: " + repo.getPermission());
                System.out.println("Repository relation: " + repo.getRelation());
                System.out.println("Repository assignees_number: " + repo.getAssignees_number());
                System.out.println("Repository testers_number: " + repo.getTesters_number());
                System.out.println("Repository assignee: " + repo.getAssignee());
                System.out.println("Repository testers: " + repo.getTesters());
                System.out.println("Repository status: " + repo.getStatus());
                System.out.println("Repository programs: " + repo.getPrograms());
                System.out.println("Repository enterprise: " + repo.getEnterprise());
                System.out.println("Repository project_labels: " + repo.getProject_labels());
                System.out.println("Repository issue_template_source: " + repo.getIssue_template_source());

                /*
{
        "id": 33680381,
        "full_name": "SilverXQ/ruan-gong-project",
        "human_name": "Silver/RuanGongProject",
        "url": "https://gitee.com/api/v5/repos/SilverXQ/ruan-gong-project",
        "namespace": {
            "id": 10321402,
            "type": "personal",
            "name": "Silver",
            "path": "SilverXQ",
            "html_url": "https://gitee.com/SilverXQ"
        },
        "path": "ruan-gong-project",
        "name": "RuanGongProject",
        "owner": {
            "id": 11432479,
            "login": "SilverXQ",
            "name": "Silver",
            "avatar_url": "https://gitee.com/assets/no_portrait.png",
            "url": "https://gitee.com/api/v5/users/SilverXQ",
            "html_url": "https://gitee.com/SilverXQ",
            "remark": "",
            "followers_url": "https://gitee.com/api/v5/users/SilverXQ/followers",
            "following_url": "https://gitee.com/api/v5/users/SilverXQ/following_url{/other_user}",
            "gists_url": "https://gitee.com/api/v5/users/SilverXQ/gists{/gist_id}",
            "starred_url": "https://gitee.com/api/v5/users/SilverXQ/starred{/owner}{/repo}",
            "subscriptions_url": "https://gitee.com/api/v5/users/SilverXQ/subscriptions",
            "organizations_url": "https://gitee.com/api/v5/users/SilverXQ/orgs",
            "repos_url": "https://gitee.com/api/v5/users/SilverXQ/repos",
            "events_url": "https://gitee.com/api/v5/users/SilverXQ/events{/privacy}",
            "received_events_url": "https://gitee.com/api/v5/users/SilverXQ/received_events",
            "type": "User"
        },
        "assigner": {
            "id": 11432479,
            "login": "SilverXQ",
            "name": "Silver",
            "avatar_url": "https://gitee.com/assets/no_portrait.png",
            "url": "https://gitee.com/api/v5/users/SilverXQ",
            "html_url": "https://gitee.com/SilverXQ",
            "remark": "",
            "followers_url": "https://gitee.com/api/v5/users/SilverXQ/followers",
            "following_url": "https://gitee.com/api/v5/users/SilverXQ/following_url{/other_user}",
            "gists_url": "https://gitee.com/api/v5/users/SilverXQ/gists{/gist_id}",
            "starred_url": "https://gitee.com/api/v5/users/SilverXQ/starred{/owner}{/repo}",
            "subscriptions_url": "https://gitee.com/api/v5/users/SilverXQ/subscriptions",
            "organizations_url": "https://gitee.com/api/v5/users/SilverXQ/orgs",
            "repos_url": "https://gitee.com/api/v5/users/SilverXQ/repos",
            "events_url": "https://gitee.com/api/v5/users/SilverXQ/events{/privacy}",
            "received_events_url": "https://gitee.com/api/v5/users/SilverXQ/received_events",
            "type": "User"
        },
        "description": "",
        "private": true,
        "public": false,
        "internal": false,
        "fork": false,
        "html_url": "https://gitee.com/SilverXQ/ruan-gong-project.git",
        "ssh_url": "git@gitee.com:SilverXQ/ruan-gong-project.git",
        "forks_url": "https://gitee.com/api/v5/repos/SilverXQ/ruan-gong-project/forks",
        "keys_url": "https://gitee.com/api/v5/repos/SilverXQ/ruan-gong-project/keys{/key_id}",
        "collaborators_url": "https://gitee.com/api/v5/repos/SilverXQ/ruan-gong-project/collaborators{/collaborator}",
        "hooks_url": "https://gitee.com/api/v5/repos/SilverXQ/ruan-gong-project/hooks",
        "branches_url": "https://gitee.com/api/v5/repos/SilverXQ/ruan-gong-project/branches{/branch}",
        "tags_url": "https://gitee.com/api/v5/repos/SilverXQ/ruan-gong-project/tags",
        "blobs_url": "https://gitee.com/api/v5/repos/SilverXQ/ruan-gong-project/blobs{/sha}",
        "stargazers_url": "https://gitee.com/api/v5/repos/SilverXQ/ruan-gong-project/stargazers",
        "contributors_url": "https://gitee.com/api/v5/repos/SilverXQ/ruan-gong-project/contributors",
        "commits_url": "https://gitee.com/api/v5/repos/SilverXQ/ruan-gong-project/commits{/sha}",
        "comments_url": "https://gitee.com/api/v5/repos/SilverXQ/ruan-gong-project/comments{/number}",
        "issue_comment_url": "https://gitee.com/api/v5/repos/SilverXQ/ruan-gong-project/issues/comments{/number}",
        "issues_url": "https://gitee.com/api/v5/repos/SilverXQ/ruan-gong-project/issues{/number}",
        "pulls_url": "https://gitee.com/api/v5/repos/SilverXQ/ruan-gong-project/pulls{/number}",
        "milestones_url": "https://gitee.com/api/v5/repos/SilverXQ/ruan-gong-project/milestones{/number}",
        "notifications_url": "https://gitee.com/api/v5/repos/SilverXQ/ruan-gong-project/notifications{?since,all,participating}",
        "labels_url": "https://gitee.com/api/v5/repos/SilverXQ/ruan-gong-project/labels{/name}",
        "releases_url": "https://gitee.com/api/v5/repos/SilverXQ/ruan-gong-project/releases{/id}",
        "recommend": false,
        "gvp": false,
        "homepage": null,
        "language": "Java",
        "forks_count": 0,
        "stargazers_count": 1,
        "watchers_count": 3,
        "default_branch": "master",
        "open_issues_count": 0,
        "has_issues": true,
        "has_wiki": true,
        "issue_comment": false,
        "can_comment": true,
        "pull_requests_enabled": true,
        "has_page": false,
        "license": null,
        "outsourced": false,
        "project_creator": "SilverXQ",
        "members": [
            "huang--yibo",
            "phenanthrenes",
            "SilverXQ"
        ],
        "pushed_at": "2024-05-04T14:48:00+08:00",
        "created_at": "2024-03-13T15:41:56+08:00",
        "updated_at": "2024-05-04T14:48:00+08:00",
        "parent": null,
        "paas": null,
        "stared": false,
        "watched": true,
        "permission": {
            "pull": true,
            "push": true,
            "admin": true
        },
        "relation": "master",
        "assignees_number": 1,
        "testers_number": 1,
        "assignee": [
            {
                "id": 11432479,
                "login": "SilverXQ",
                "name": "Silver",
                "avatar_url": "https://gitee.com/assets/no_portrait.png",
                "url": "https://gitee.com/api/v5/users/SilverXQ",
                "html_url": "https://gitee.com/SilverXQ",
                "remark": "",
                "followers_url": "https://gitee.com/api/v5/users/SilverXQ/followers",
                "following_url": "https://gitee.com/api/v5/users/SilverXQ/following_url{/other_user}",
                "gists_url": "https://gitee.com/api/v5/users/SilverXQ/gists{/gist_id}",
                "starred_url": "https://gitee.com/api/v5/users/SilverXQ/starred{/owner}{/repo}",
                "subscriptions_url": "https://gitee.com/api/v5/users/SilverXQ/subscriptions",
                "organizations_url": "https://gitee.com/api/v5/users/SilverXQ/orgs",
                "repos_url": "https://gitee.com/api/v5/users/SilverXQ/repos",
                "events_url": "https://gitee.com/api/v5/users/SilverXQ/events{/privacy}",
                "received_events_url": "https://gitee.com/api/v5/users/SilverXQ/received_events",
                "type": "User"
            }
        ],
        "testers": [
            {
                "id": 11432479,
                "login": "SilverXQ",
                "name": "Silver",
                "avatar_url": "https://gitee.com/assets/no_portrait.png",
                "url": "https://gitee.com/api/v5/users/SilverXQ",
                "html_url": "https://gitee.com/SilverXQ",
                "remark": "",
                "followers_url": "https://gitee.com/api/v5/users/SilverXQ/followers",
                "following_url": "https://gitee.com/api/v5/users/SilverXQ/following_url{/other_user}",
                "gists_url": "https://gitee.com/api/v5/users/SilverXQ/gists{/gist_id}",
                "starred_url": "https://gitee.com/api/v5/users/SilverXQ/starred{/owner}{/repo}",
                "subscriptions_url": "https://gitee.com/api/v5/users/SilverXQ/subscriptions",
                "organizations_url": "https://gitee.com/api/v5/users/SilverXQ/orgs",
                "repos_url": "https://gitee.com/api/v5/users/SilverXQ/repos",
                "events_url": "https://gitee.com/api/v5/users/SilverXQ/events{/privacy}",
                "received_events_url": "https://gitee.com/api/v5/users/SilverXQ/received_events",
                "type": "User"
            }
        ],
        "status": "开始",
        "programs": [

        ],
        "enterprise": null,
        "project_labels": [

        ],
        "issue_template_source": "project"
    }
 */

                repo.setId(0);
                repo.setFull_name("SilverXQ/HelloWorld");
                repo.setHuman_name("HelloWorld");
                repo.setUrl("https://gitee.com/SilverXQ/HelloWorld");
                GiteeRepository.Namespace namespace = new GiteeRepository.Namespace();
                namespace.setId(1);
                namespace.setType("enterprise");
                namespace.setName("SilverXQ");
                namespace.setPath("SilverXQ");
                namespace.setHtml_url("https://gitee.com/SilverXQ");
                repo.setNamespace(new GiteeRepository.Namespace(namespace.getId(), namespace.getType(), namespace.getName(), namespace.getPath(), namespace.getHtml_url()));
                repo.setPath("HelloWorld");
                repo.setName("HelloWorld");
                GiteeRepository.Owner owner = new GiteeRepository.Owner();
                owner.setId(1);
                owner.setLogin("SilverXQ");
                owner.setName("Silver");
                owner.setAvatar_url("https://gitee.com/assets/no_portrait.png");
                owner.setUrl("https://gitee.com/api/v5/users/SilverXQ");
                owner.setHtml_url("https://gitee.com/SilverXQ");
                owner.setRemark("");
                owner.setFollowers_url("https://gitee.com/api/v5/users/SilverXQ/followers");
                owner.setFollowing_url("https://gitee.com/api/v5/users/SilverXQ/following_url{/other_user}");
                owner.setGists_url("https://gitee.com/api/v5/users/SilverXQ/gists{/gist_id}");
                owner.setStarred_url("https://gitee.com/api/v5/users/SilverXQ/starred{/owner}{/repo}");
                owner.setSubscriptions_url("https://gitee.com/api/v5/users/SilverXQ/subscriptions");
                owner.setOrganizations_url("https://gitee.com/api/v5/users/SilverXQ/orgs");
                owner.setRepos_url("https://gitee.com/api/v5/users/SilverXQ/repos");
                owner.setEvents_url("https://gitee.com/api/v5/users/SilverXQ/events{/privacy}");
                owner.setReceived_events_url("https://gitee.com/api/v5/users/SilverXQ/received_events");
                owner.setType("User");
                repo.setOwner(new GiteeRepository.Owner(owner.getId(), owner.getLogin(), owner.getName(), owner.getAvatar_url(), owner.getUrl(), owner.getHtml_url(), owner.getRemark(), owner.getFollowers_url(), owner.getFollowing_url(), owner.getGists_url(), owner.getStarred_url(), owner.getSubscriptions_url(), owner.getOrganizations_url(), owner.getRepos_url(), owner.getEvents_url(), owner.getReceived_events_url(), owner.getType()));

                GiteeRepository.Assigner assigner =new GiteeRepository.Assigner();
                assigner.setId(1);
                assigner.setLogin("SilverXQ");
                assigner.setName("Silver");
                assigner.setAvatar_url("https://gitee.com/assets/no_portrait.png");
                assigner.setUrl("https://gitee.com/api/v5/users/SilverXQ");
                assigner.setHtml_url("https://gitee.com/SilverXQ");
                assigner.setRemark("");
                assigner.setFollowers_url("https://gitee.com/api/v5/users/SilverXQ/followers");
                assigner.setFollowing_url("https://gitee.com/api/v5/users/SilverXQ/following_url{/other_user}");
                assigner.setGists_url("https://gitee.com/api/v5/users/SilverXQ/gists{/gist_id}");
                assigner.setStarred_url("https://gitee.com/api/v5/users/SilverXQ/starred{/owner}{/repo}");
                assigner.setSubscriptions_url("https://gitee.com/api/v5/users/SilverXQ/subscriptions");
                assigner.setOrganizations_url("https://gitee.com/api/v5/users/SilverXQ/orgs");
                assigner.setRepos_url("https://gitee.com/api/v5/users/SilverXQ/repos");
                assigner.setEvents_url("https://gitee.com/api/v5/users/SilverXQ/events{/privacy}");
                assigner.setReceived_events_url("https://gitee.com/api/v5/users/SilverXQ/received_events");
                assigner.setType("User");
                repo.setAssigner(new GiteeRepository.Assigner(assigner.getId(), assigner.getLogin(), assigner.getName(), assigner.getAvatar_url(), assigner.getUrl(), assigner.getHtml_url(), assigner.getRemark(), assigner.getFollowers_url(), assigner.getFollowing_url(), assigner.getGists_url(), assigner.getStarred_url(), assigner.getSubscriptions_url(), assigner.getOrganizations_url(), assigner.getRepos_url(), assigner.getEvents_url(), assigner.getReceived_events_url(), assigner.getType()));
                repo.setDescription("This is a test repository.");
                repo.setPrivate(false);
                repo.setPublic(true);
                repo.setInternal(false);
                repo.setIsFork(false);
                repo.setHtml_url("https://gitee.com/SilverXQ/HelloWorld");
                repo.setSsh_url("https://gitee.com/SilverXQ/HelloWorld.git");
                repo.setForks_url("https://gitee.com/api/v5/repos/SilverXQ/HelloWorld/forks");
                repo.setKeys_url("https://gitee.com/api/v5/repos/SilverXQ/HelloWorld/keys");
                repo.setCollaborators_url("https://gitee.com/api/v5/repos/SilverXQ/HelloWorld/collaborators{/collaborator}");
                repo.setHooks_url("https://gitee.com/api/v5/repos/SilverXQ/HelloWorld/hooks");
                repo.setBranches_url("https://gitee.com/api/v5/repos/SilverXQ/HelloWorld/branches");
                repo.setTags_url("https://gitee.com/api/v5/repos/SilverXQ/HelloWorld/tags");
                repo.setBlobs_url("https://gitee.com/api/v5/repos/SilverXQ/HelloWorld/git/blobs{/sha}");
                repo.setStargazers_url("https://gitee.com/api/v5/repos/SilverXQ/HelloWorld/stargazers");
                repo.setContributors_url("https://gitee.com/api/v5/repos/SilverXQ/HelloWorld/contributors");
                repo.setCommits_url("https://gitee.com/api/v5/repos/SilverXQ/HelloWorld/commits{/sha}");
                repo.setComments_url("https://gitee.com/api/v5/repos/SilverXQ/HelloWorld/comments{/number}");
                repo.setIssue_comment_url("https://gitee.com/api/v5/repos/SilverXQ/HelloWorld/issues/comments{/number}");
                repo.setIssues_url("https://gitee.com/api/v5/repos/SilverXQ/HelloWorld/issues{/number}");
                repo.setPulls_url("https://gitee.com/api/v5/repos/SilverXQ/HelloWorld/pulls{/number}");
                repo.setMilestones_url("https://gitee.com/api/v5/repos/SilverXQ/HelloWorld/milestones{/number}");
                repo.setNotifications_url("https://gitee.com/api/v5/repos/SilverXQ/HelloWorld/notifications{?since,all,participating}");
                repo.setLabels_url("https://gitee.com/api/v5/repos/SilverXQ/HelloWorld/labels{/name}");
                repo.setReleases_url("https://gitee.com/api/v5/repos/SilverXQ/HelloWorld/releases{/id}");
                repo.setRecommend(false);
                repo.setGvp(false);
                repo.setHomepage("https://gitee.com/SilverXQ/HelloWorld");
                repo.setLanguage("Java");
                repo.setForks_count(0);
                repo.setStargazers_count(0);
                repo.setWatchers_count(0);
                repo.setDefault_branch("master");
                repo.setOpen_issues_count(0);
                repo.setHas_issues(false);
                repo.setHas_wiki(false);
                repo.setIssue_comment(false);
                repo.setCan_comment(false);
                repo.setPull_requests_enabled(true);
                repo.setHas_page(true);
                GiteeRepository.License license = new GiteeRepository.License();
                license.setKey("apache-2.0");
                license.setName("Apache License 2.0");
                license.setSpdx_id("Apache-2.0");
                license.setUrl("https://gitee.com/api/v5/licenses/apache-2.0");
                license.setNode_id("MDc6TGljZW5zZTI=");
                repo.setLicense(null);
                repo.setOutsourced(false);
                repo.setProject_creator("SilverXQ");
                repo.setMembers(null);
                repo.setPushed_at("2021-07-07T15:00:00+08:00");
                repo.setCreated_at("2021-07-07T15:00:00+08:00");
                repo.setUpdated_at("2021-07-07T15:00:00+08:00");
                repo.setParent(null);
                repo.setPaas(null);
                repo.setStared(false);
                repo.setWatched(false);
                GiteeRepository.Permission permission = new GiteeRepository.Permission();
                permission.setPull(true);
                permission.setPush(true);
                permission.setAdmin(true);
                repo.setPermission(new GiteeRepository.Permission(permission.isPull(), permission.isPush(), permission.isAdmin()));
                repo.setRelation("owner");
                repo.setAssignees_number(0);
                repo.setTesters_number(0);
                GiteeRepository.Assignee assignee = new GiteeRepository.Assignee();
                assignee.setId(1);
                assignee.setLogin("SilverXQ");
                assignee.setName("Silver");
                assignee.setAvatar_url("https://gitee.com/assets/no_portrait.png");
                assignee.setUrl("https://gitee.com/api/v5/users/SilverXQ");
                assignee.setHtml_url("https://gitee.com/SilverXQ");
                assignee.setRemark("");
                assignee.setFollowers_url("https://gitee.com/api/v5/users/SilverXQ/followers");
                assignee.setFollowing_url("https://gitee.com/api/v5/users/SilverXQ/following_url{/other_user}");
                assignee.setGists_url("https://gitee.com/api/v5/users/SilverXQ/gists{/gist_id}");
                assignee.setStarred_url("https://gitee.com/api/v5/users/SilverXQ/starred{/owner}{/repo}");
                assignee.setSubscriptions_url("https://gitee.com/api/v5/users/SilverXQ/subscriptions");
                assignee.setOrganizations_url("https://gitee.com/api/v5/users/SilverXQ/orgs");
                assignee.setRepos_url("https://gitee.com/api/v5/users/SilverXQ/repos");
                assignee.setEvents_url("https://gitee.com/api/v5/users/SilverXQ/events{/privacy}");
                assignee.setReceived_events_url("https://gitee.com/api/v5/users/SilverXQ/received_events");
                assignee.setType("User");
                List<GiteeRepository.Assignee> assigneeList=new ArrayList<>();
                assigneeList.add(assignee);
                repo.setAssignee(assigneeList);
                GiteeRepository.Tester tester = new GiteeRepository.Tester();
                tester.setId(1);
                tester.setLogin("SilverXQ");
                tester.setName("Silver");
                tester.setAvatar_url("https://gitee.com/assets/no_portrait.png");
                tester.setUrl("https://gitee.com/api/v5/users/SilverXQ");
                tester.setHtml_url("https://gitee.com/SilverXQ");
                tester.setRemark("");
                tester.setFollowers_url("https://gitee.com/api/v5/users/SilverXQ/followers");
                tester.setFollowing_url("https://gitee.com/api/v5/users/SilverXQ/following_url{/other_user}");
                tester.setGists_url("https://gitee.com/api/v5/users/SilverXQ/gists{/gist_id}");
                tester.setStarred_url("https://gitee.com/api/v5/users/SilverXQ/starred{/owner}{/repo}");
                tester.setSubscriptions_url("https://gitee.com/api/v5/users/SilverXQ/subscriptions");
                tester.setOrganizations_url("https://gitee.com/api/v5/users/SilverXQ/orgs");
                tester.setRepos_url("https://gitee.com/api/v5/users/SilverXQ/repos");
                tester.setEvents_url("https://gitee.com/api/v5/users/SilverXQ/events{/privacy}");
                tester.setReceived_events_url("https://gitee.com/api/v5/users/SilverXQ/received_events");
                tester.setType("User");
//                repo.setTesters(new GiteeRepository.Tester(tester.getId(), tester.getLogin(), tester.getName(), tester.getAvatar_url(), tester.getUrl(), tester.getHtml_url(), tester.getRemark(), tester.getFollowers_url(), tester.getFollowing_url(), tester.getGists_url(), tester.getStarred_url(), tester.getSubscriptions_url(), tester.getOrganizations_url(), tester.getRepos_url(), tester.getEvents_url(), tester.getReceived_events_url(), tester.getType()));
                repo.setStatus("active");
                GiteeRepository.Program program = new GiteeRepository.Program();
//                repo.setPrograms(program);
                GiteeRepository.Enterprise enterprise = new GiteeRepository.Enterprise();
                enterprise.setId(1);
                enterprise.setType("enterprise");
                enterprise.setPath("SilverXQ");
                enterprise.setName("SilverXQ");
                enterprise.setHtml_url("https://gitee.com/SilverXQ");
                repo.setEnterprise(new GiteeRepository.Enterprise(enterprise.getId(), enterprise.getType(), enterprise.getPath(), enterprise.getName(), enterprise.getHtml_url()));
                repo.setProject_labels(null);
                repo.setIssue_template_source("project");


                System.out.println("===================================================================");
                System.out.println("Repository id: " + repo.getId());
                System.out.println("Repository full_name: " + repo.getFull_name());
                System.out.println("Repository human_name: " + repo.getHuman_name());
                System.out.println("Repository url: " + repo.getUrl());
                System.out.println("Repository namespace: " + repo.getNamespace());
                System.out.println("Repository path: " + repo.getPath());
                System.out.println("Repository name: " + repo.getName());
                System.out.println("Repository owner: " + repo.getOwner());
                System.out.println("Repository assigner: " + repo.getAssigner());
                System.out.println("Repository description " + repo.getDescription());
                System.out.println("Repository private: " + repo.getPrivate());
                System.out.println("Repository public: " + repo.getPublic());
                System.out.println("Repository internal: " + repo.getInternal());
                System.out.println("Repository fork: " + repo.isIsFork());
                System.out.println("Repository html_url: " + repo.getHtml_url());
                System.out.println("Repository ssh_url: " + repo.getSsh_url());
                System.out.println("Repository forks_url: " + repo.getForks_url());
                System.out.println("Repository keys_url: " + repo.getKeys_url());
                System.out.println("Repository collaborators_url: " + repo.getCollaborators_url());
                System.out.println("Repository hooks_url: " + repo.getHooks_url());
                System.out.println("Repository branches_url: " + repo.getBranches_url());
                System.out.println("Repository tags_url: " + repo.getTags_url());
                System.out.println("Repository blobs_url: " + repo.getBlobs_url());
                System.out.println("Repository stargazers_url: " + repo.getStargazers_url());
                System.out.println("Repository contributors_url: " + repo.getContributors_url());
                System.out.println("Repository commits_url: " + repo.getCommits_url());
                System.out.println("Repository comments_url: " + repo.getComments_url());
                System.out.println("Repository issue_comment_url: " + repo.getIssue_comment_url());
                System.out.println("Repository issues_url: " + repo.getIssues_url());
                System.out.println("Repository pulls_url: " + repo.getPulls_url());
                System.out.println("Repository milestones_url: " + repo.getMilestones_url());
                System.out.println("Repository notifications_url: " + repo.getNotifications_url());
                System.out.println("Repository labels_url: " + repo.getLabels_url());
                System.out.println("Repository releases_url: " + repo.getReleases_url());
                System.out.println("Repository recommend: " + repo.isRecommend());
                System.out.println("Repository gvp: " + repo.isGvp());
                System.out.println("Repository homepage: " + repo.getHomepage());
                System.out.println("Repository language: " + repo.getLanguage());
                System.out.println("Repository forks_count: " + repo.getForks_count());
                System.out.println("Repository stargazers_count: " + repo.getStargazers_count());
                System.out.println("Repository watchers_count: " + repo.getWatchers_count());
                System.out.println("Repository default_branch: " + repo.getDefault_branch());
                System.out.println("Repository open_issues_count: " + repo.getOpen_issues_count());
                System.out.println("Repository has_issues: " + repo.isHas_issues());
                System.out.println("Repository has_wiki: " + repo.isHas_wiki());
                System.out.println("Repository issue_comment: " + repo.isIssue_comment());
                System.out.println("Repository can_comment: " + repo.isCan_comment());
                System.out.println("Repository pull_requests_enabled: " + repo.isPull_requests_enabled());
                System.out.println("Repository has_page: " + repo.isHas_page());
                System.out.println("Repository license: " + repo.getLicense());
                System.out.println("Repository outsourced: " + repo.isOutsourced());
                System.out.println("Repository project_creator: " + repo.getProject_creator());
                System.out.println("Repository members: " + repo.getMembers());
                System.out.println("Repository pushed_at: " + repo.getPushed_at());
                System.out.println("Repository created_at: " + repo.getCreated_at());
                System.out.println("Repository updated_at: " + repo.getUpdated_at());
                System.out.println("Repository parent: " + repo.getParent());
                System.out.println("Repository paas: " + repo.getPaas());
                System.out.println("Repository stared: " + repo.isStared());
                System.out.println("Repository watched: " + repo.isWatched());
                System.out.println("Repository permission: " + repo.getPermission());
                System.out.println("Repository relation: " + repo.getRelation());
                System.out.println("Repository assignees_number: " + repo.getAssignees_number());
                System.out.println("Repository testers_number: " + repo.getTesters_number());
                System.out.println("Repository assignee: " + repo.getAssignee());
                System.out.println("Repository testers: " + repo.getTesters());
                System.out.println("Repository status: " + repo.getStatus());
                System.out.println("Repository programs: " + repo.getPrograms());
                System.out.println("Repository enterprise: " + repo.getEnterprise());
                System.out.println("Repository project_labels: " + repo.getProject_labels());
                System.out.println("Repository issue_template_source: " + repo.getIssue_template_source());

            } else {
                System.out.println("Failed to get response");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
